/* GUI CONVERTED from reupdsca.p (converter v1.76) Fri Apr 26 10:58:08 2002 */
/* reupdsca.p - REPETITIVE (Update Component Requirements)                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.8 $                                                           */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3      LAST MODIFIED: 10/31/94   BY: WUG *GN77*                */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown         */
/* REVISION: 9.1      LAST MODIFIED: 11/13/00   BY: *N0TN* Jean Miller        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.8 $     BY: Jean Miller          DATE: 04/16/02  ECO: *P05S*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}
{gplabel.i}

define input parameter lot as character.
define input parameter op as integer.
define input parameter proportion_completed as decimal.

define variable prev_iss_qty as decimal.
define variable qty_open     as decimal.

for each wod_det exclusive-lock
   where wod_lot = lot
     and wod_op = op:
/*GUI*/ if global-beam-me-up then undo, leave.


   prev_iss_qty = wod_qty_iss.
   wod_qty_iss = round(proportion_completed * wod_qty_req, 8).

   find in_mstr where in_part = wod_part and in_site = wod_site
   exclusive-lock no-error.

   if available in_mstr then do:
      in_qty_req = in_qty_req - (wod_qty_iss - prev_iss_qty).
   end.

   qty_open = wod_qty_req - wod_qty_iss.

   {mfmrw.i "wod_det" wod_part wod_nbr wod_lot string(wod_op)
      ? wod_iss_date qty_open "DEMAND" " " wod_site}

end.
/*GUI*/ if global-beam-me-up then undo, leave.

